Patch up t2h for texinfo 7.1
authorSebastian Ramacher <sramacher@debian.org>
Tue, 31 Oct 2023 23:03:06 +0000 (00:03 +0100)
committerSebastian Ramacher <sramacher@debian.org>
Tue, 31 Oct 2023 23:06:10 +0000 (00:06 +0100)
This is not perfect, but the results looks okay and makes the build
pass.

Gbp-Pq: Name 0005-Patch-up-t2h-for-texinfo-7.1.patch

doc/t2h.pm

index d07d974286c4ad2663b25d665db0cb95edc9fd94..5e32f3aa6eda9818050a41b84bc9ba8d24898133 100644 (file)
@@ -21,7 +21,7 @@
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
 # no navigation elements
-set_from_init_file('HEADERS', 0);
+texinfo_set_from_init_file('HEADERS', 0);
 
 sub ffmpeg_heading_command($$$$$)
 {
@@ -112,8 +112,8 @@ sub ffmpeg_heading_command($$$$$)
                 $cmdname
                     = $Texinfo::Common::level_to_structuring_command{$cmdname}->[$heading_level];
             }
-            $result .= &{$self->{'format_heading_text'}}(
-                        $self, $cmdname, $heading,
+            $result .= &{$self->formatting_function('format_heading_text')}(
+                        $self, $cmdname, [$heading],
                         $heading_level +
                         $self->get_conf('CHAPTER_HEADER_LEVEL') - 1, $command);
         }
@@ -127,22 +127,22 @@ foreach my $command (keys(%Texinfo::Common::sectioning_commands), 'node') {
 }
 
 # determine if texinfo is at least version 6.8
-my $program_version_num = version->declare(get_conf('PACKAGE_VERSION'))->numify;
+my $program_version_num = version->declare(texinfo_get_conf('PACKAGE_VERSION'))->numify;
 my $program_version_6_8 = $program_version_num >= 6.008000;
 
 # print the TOC where @contents is used
 if ($program_version_6_8) {
-    set_from_init_file('CONTENTS_OUTPUT_LOCATION', 'inline');
+    texinfo_set_from_init_file('CONTENTS_OUTPUT_LOCATION', 'inline');
 } else {
-    set_from_init_file('INLINE_CONTENTS', 1);
+    texinfo_set_from_init_file('INLINE_CONTENTS', 1);
 }
 
 # make chapters <h2>
-set_from_init_file('CHAPTER_HEADER_LEVEL', 2);
+texinfo_set_from_init_file('CHAPTER_HEADER_LEVEL', 2);
 
 # Do not add <hr>
-set_from_init_file('DEFAULT_RULE', '');
-set_from_init_file('BIG_RULE', '');
+texinfo_set_from_init_file('DEFAULT_RULE', '');
+texinfo_set_from_init_file('BIG_RULE', '');
 
 # Customized file beginning
 sub ffmpeg_begin_file($$$)
@@ -193,7 +193,7 @@ EOT
     return $head1 . $head_title . $head2 . $head_title . $head3;
 }
 if ($program_version_6_8) {
-    texinfo_register_formatting_function('format_begin_file', \&ffmpeg_begin_file);
+  # texinfo_register_formatting_function('format_begin_file', \&ffmpeg_begin_file);
 } else {
     texinfo_register_formatting_function('begin_file', \&ffmpeg_begin_file);
 }
@@ -223,7 +223,7 @@ if ($program_version_6_8) {
 sub ffmpeg_end_file($)
 {
     my $self = shift;
-    my $program_string = &{$self->{'format_program_string'}}($self);
+    my $program_string = &{$self->formatting_function('format_program_string')}($self);
     my $program_text = <<EOT;
       <p style="font-size: small;">
         $program_string
@@ -244,7 +244,7 @@ if ($program_version_6_8) {
 
 # Dummy title command
 # Ignore title. Title is handled through ffmpeg_begin_file().
-set_from_init_file('USE_TITLEPAGE_FOR_TITLE', 1);
+texinfo_set_from_init_file('USE_TITLEPAGE_FOR_TITLE', 1);
 sub ffmpeg_title($$$$)
 {
     return '';
@@ -262,7 +262,7 @@ sub ffmpeg_float($$$$$)
     my $args = shift;
     my $content = shift;
 
-    my ($caption, $prepended) = Texinfo::Common::float_name_caption($self,
+    my ($caption, $prepended) = Texinfo::Convert::Converter::float_name_caption($self,
                                                                 $command);
     my $caption_text = '';
     my $prepended_text;
@@ -335,7 +335,7 @@ sub ffmpeg_float($$$$$)
             $caption->{'args'}->[0], 'float caption');
     }
     if ($prepended_text.$caption_text ne '') {
-        $prepended_text = $self->_attribute_class('div','float-caption'). '>'
+        $prepended_text = $self->html_attribute_class('div',['float-caption']). '>'
                 . $prepended_text;
         $caption_text .= '</div>';
     }
@@ -349,7 +349,7 @@ sub ffmpeg_float($$$$$)
         $prepended_text = '';
         $caption_text   = '';
     }
-    return $self->_attribute_class('div', $html_class). '>' . "\n" .
+    return $self->html_attribute_class('div', [$html_class]). '>' . "\n" .
         $prepended_text . $caption_text . $content . '</div>';
 }